package com.heima.job4;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
      int result =  userCalculator(( a, b)->a + b);
        System.out.println(result);
    }
    public static int userCalculator(Calculator calculator){
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入加数：");
        int a = sc.nextInt();
        System.out.println("请输入被加数：");
        int b = sc.nextInt();
        return calculator.calc(a,b);
    }
}
